package com.blueocean_health.care.management.domain.dto;

import java.util.Date;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;
import com.blueocean_health.care.management.common.base.em.TimeType;
import com.blueocean_health.care.management.common.base.string.StringUtils;
import com.blueocean_health.care.management.common.base.time.TimeUtils;
import com.blueocean_health.care.management.common.excel.ExcelResources;

@Table(name = "reserve_funds")
public class ReserveFundsDto {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    /**
     * 医院Id
     */
    private String hospitalId;
    

    
    private String userRealName;

    /**
     * 发生日期
     */
    @JSONField(format="yyyy-MM-dd")
    @Column(name = "record_day")
    private Date recordDay;

    /**
     * 费用类别Id
     */
    @Column(name = "reserve_fee_type")
    private String[] reserveFeeType;

    /**
     * 费用类别名称
     */
    @Column(name = "reserve_fee_name")
    private String reserveFeeName;

    /**
     * 费用说明
     */
    @Column(name = "fee_remark")
    private String feeRemark;

    /**
     * 账目类型 1：支出 2：收入
     */
    @Column(name = "accounts_type")
    private String accountsType;
    
    private String income;
    
    private String expend;
    
    private String balance;

    /**
     * 账目费用
     */
    @Column(name = "accounts_fee")
    private Double accountsFee;

    /**
     * 负责人
     */
    private String manager;

    /**
     * 是否有票据 0：无 1：有
     */
    @Column(name = "have_bill")
    private String haveBill;

    
    /**
     * 修改时间
     */
    @JSONField(format="yyyy-MM-dd HH:mm:ss.SSS")
    @Column(name = "update_time")
    private Date updateTime;

    /**
     * @return id
     */
    public Integer getId() {
        return id;
    }

    /**
     * @param id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    public String getHospitalId() {
		return hospitalId;
	}

	public void setHospitalId(String hospitalId) {
		this.hospitalId = hospitalId;
	}
	
	 @ExcelResources(title = "负责人", order = 7)
	public String getUserRealName() {
		return userRealName;
	}

	public void setUserRealName(String userRealName) {
		this.userRealName = userRealName;
	}

	/**
     * 获取发生日期
     *
     * @return record_day - 发生日期
     */
	@ExcelResources(title = "账款发生日期", order = 1)
    public String getRecordDay() {
		if(StringUtils.isEmpty(recordDay)){
			return null;
		}
	    String stringByDate = TimeUtils.getStringByDate(recordDay, TimeType.yyyy_MM_dd);
        return stringByDate;
    }

    /**
     * 设置发生日期
     *
     * @param recordDay 发生日期
     */
    public void setRecordDay(Date recordDay) {
        this.recordDay = recordDay;
    }

    /**
     * 获取费用类别Id
     *
     * @return reserve_fee_type - 费用类别Id
     */
    public String[] getReserveFeeType() {
    	if(StringUtils.isEmpty(reserveFeeType)){
    		return null;
    	}
//    	String[] split = reserveFeeType.split(",");
        return reserveFeeType;
    }

    /**
     * 设置费用类别Id
     *
     * @param reserveFeeType 费用类别Id
     */
    public void setReserveFeeType(String[] reserveFeeType) {
        this.reserveFeeType = reserveFeeType;
    }
    @ExcelResources(title = "收入", order = 4, isNum = 1)
    public String getIncome() {
		return income;
	}

	public void setIncome(String income) {
		this.income = income;
	}
	@ExcelResources(title = "支出", order = 5, isNum = 1)
	public String getExpend() {
		return expend;
	}

	public void setExpend(String expend) {
		this.expend = expend;
	}
	@ExcelResources(title = "余额", order = 6, isNum = 1)
	public String getBalance() {
		return balance;
	}

	public void setBalance(String balance) {
		this.balance = balance;
	}

	/**
     * 获取费用类别名称
     *
     * @return reserve_fee_name - 费用类别名称
     */
	@ExcelResources(title = "费用类别", order = 2)
    public String getReserveFeeName() {
        return reserveFeeName;
    }

    /**
     * 设置费用类别名称
     *
     * @param reserveFeeName 费用类别名称
     */
    public void setReserveFeeName(String reserveFeeName) {
        this.reserveFeeName = reserveFeeName;
    }

    /**
     * 获取费用说明
     *
     * @return fee_remark - 费用说明
     */
    @ExcelResources(title = "费用说明", order = 3)
    public String getFeeRemark() {
        return feeRemark;
    }

    /**
     * 设置费用说明
     *
     * @param feeRemark 费用说明
     */
    public void setFeeRemark(String feeRemark) {
        this.feeRemark = feeRemark;
    }

    /**
     * 获取账目类型 1：支出 2：收入
     *
     * @return accounts_type - 账目类型 1：支出 2：收入
     */
    public String getAccountsType() {
        return accountsType;
    }

    /**
     * 设置账目类型 1：支出 2：收入
     *
     * @param accountsType 账目类型 1：支出 2：收入
     */
    public void setAccountsType(String accountsType) {
        this.accountsType = accountsType;
    }

    /**
     * 获取账目费用
     *
     * @return accounts_fee - 账目费用
     */
    public Double getAccountsFee() {
        return accountsFee;
    }

    /**
     * 设置账目费用
     *
     * @param accountsFee 账目费用
     */
    public void setAccountsFee(Double accountsFee) {
        this.accountsFee = accountsFee;
    }

    /**
     * 获取负责人
     *
     * @return manager - 负责人
     */
   
    public String getManager() {
        return manager;
    }

    /**
     * 设置负责人
     *
     * @param manager 负责人
     */
    public void setManager(String manager) {
        this.manager = manager;
    }

    /**
     * 获取是否有票据 2：无 1：有
     *
     * @return have_bill - 是否有票据 2：无 1：有
     */
    @ExcelResources(title = "是否有票据", order = 8)
    public String getHaveBill() {
    	String bill = "";
    	if("2".equals(haveBill)){
    		bill = "无";
    	}else if("1".equals(haveBill)){
    		bill = "有";
    	}
        return bill;
    }

    /**
     * 设置是否有票据 2：无 1：有
     *
     * @param haveBill 是否有票据 2：无 1：有
     */
    public void setHaveBill(String haveBill) {
        this.haveBill = haveBill;
    }


    /**
     * 获取修改时间
     *
     * @return update_time - 修改时间
     */
    @ExcelResources(title = "提交时间", order = 9)
    public String getUpdateTime() {
    	if(StringUtils.isEmpty(updateTime)){
			return null;
		}
	    String stringByDate = TimeUtils.getStringByDate(updateTime, TimeType.yyyy_MM_dd_HH_mm_ss);
        return stringByDate;
    }

    /**
     * 设置修改时间
     *
     * @param updateTime 修改时间
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

	@Override
	public String toString() {
		return "ReserveFundsDto [id=" + id + ", hospitalId=" + hospitalId + ", recordDay=" + recordDay
				+ ", reserveFeeType=" + reserveFeeType + ", reserveFeeName=" + reserveFeeName + ", feeRemark="
				+ feeRemark + ", accountsType=" + accountsType + ", income=" + income + ", expend=" + expend
				+ ", balance=" + balance + ", accountsFee=" + accountsFee + ", manager=" + manager + ", haveBill="
				+ haveBill + ", updateTime=" + updateTime + "]";
	}


}